package com.opoc.mapper;

import com.opoc.pojo.Pool_sql;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface PoolMapper {

  /**
   * 获取池子基本信息
   */
  List<Pool_sql> getPoolBasicInfo(@Param("company_name") String company_name,
                              @Param("pool_id") String pool_id,
                              @Param("pool_name") String pool_name);

  /**
   * 添加池子
   */
  void addPool(Pool_sql poolSql);

  /**
   * 获取池子全部信息
   */
  @Select("select * from pool where pool_id = #{pool_id}")
  Pool_sql getPoolAllInfoByPoolId(String pool_id);

  /**
   * 池子检测信息查询
   */
  List<Pool_sql> getPoolDetectionInfo(@Param("company_name") String company_name,
                                  @Param("pool_id") String pool_id,
                                  @Param("pool_name") String pool_name);

  /**
   * 批量删除池子
   */
  void deletePoolById(@Param("pool_id") String pool_id);

  /**
   * 校验池子是否已存在
   */
  @Select("select exists(select * from pool where pool_id = #{pool_id})")
  boolean validatePoolById(String pool_id);

  void uploadImage(@Param("sewage_treatment_flow_chart_path") String sewage_treatment_flow_chart_path,
                   @Param("pool_code_path") String pool_code_path,
                   @Param("pool_id") String pool_id);
}
